﻿using System;
using System.Collections.Generic;
//using System.Linq;
using System.Text;

namespace ATA.Business
{
    public class Utility
    {
        public static DateTime? getDateTime(object objDateTime)
        {
            if (objDateTime == null)
            {
                return null;
            }
            else
            {
                DateTime _DateTime;
                if (DateTime.TryParse(objDateTime.ToString(), out _DateTime) == false)
                    return null;
                else return _DateTime;
            }
        }

        //public static void setEmptyTextToTextBoxes(System.Windows.Forms.Control ParentControl)
        //{
        //    if (ParentControl != null)
        //    {
        //        if (ParentControl.HasChildren == true)
        //        {
        //            foreach (System.Windows.Forms.Control _Control in ParentControl.Controls)
        //            {
        //                if (_Control.GetType() == typeof(Infragistics.Win.UltraWinEditors.UltraTextEditor))
        //                {
        //                    ((Infragistics.Win.UltraWinEditors.UltraTextEditor)_Control).Text = string.Empty;
        //                }
        //                else if (_Control.HasChildren == true)
        //                    setEmptyTextToTextBoxes(_Control);
        //            }
        //        }
        //    }
        //}
    }
}
